#!/usr/bin/env python
# -*- coding: utf-8 -*-

import requests
# import json

def get(user_id, url):
    a = requests.Session()
    a.get(url)
    # print a.cookies.get('cVote')
    jsondata = { 'user_id': user_id, 'aid': "8wwc"  }
    html = a.post(r'http://campus.finance365.com/Rematch/Handler', params=jsondata)

if __name__ == '__main__':
    import time
    from random import randint
    times = raw_input("投多少票?: ")

    if not times.isdigit():
        print "输入错误, 请回车退出，重新来过"
        raw_input()
        exit(0)

    for i in range(int(times)):
        get('201405201054219997', 'http://campus.finance365.com/Rematch/UserCenter/47')
        seconds = randint(13, 93)
        print '已投',i+1,'票'
        print str(seconds)+'秒后投第' + str(i+2) + '票'
        print ""
        time.sleep(seconds)
